- var clientName = client.client_name || 'A new MCP Client'
- var logo = client.logo || client.logo_url || 'https://placehold.co/100x100/EEE/31343C?font=montserrat&text=MCP Client'
- var website = client.client_uri || client.website 
- var redirectUris = client.redirect_uris
- var serverName = 'Neon MCP Server'

html(lang='en')
  head
    meta(charset='utf-8')
    meta(name='viewport', content='width=device-width, initial-scale=1')
    style
      include styles.css
    title #{clientName} | Authorization Request
  body
    div(class='container')
      div(class='precard')
        a(class="header", href='/', target='_blank')
          img(src='/logo.png', alt="Neon MCP", class="logo")
      div(class="card")
        h2(class="alert") 
          strong MCP Client Authorization Request
        div(class="client-info")
          div(class='client-detail')
            div(class='detail-label') Name:
            div(class='detail-value') #{clientName}
          if website
            div(class='client-detail')
              div(class='detail-label') Website:
              div(class='detail-value small')
                a(href=website, target='_blank' rel='noopener noreferrer') #{website}
          if redirectUris
            div(class='client-detail')
              div(class='detail-label') Redirect URIs:
              div(class='detail-value small')
                each uri in redirectUris
                  div #{uri}
        p(class="description") This MCP client is requesting to be authorized 
          | on #{serverName}. If you approve, you will be redirected to complete the authentication. 

        form(method='POST', action='/authorize')
          input(type='hidden', name='state', value=state)
          
          div(class='actions')
            button(type='button', class='button button-secondary' onclick='window.history.back()') Cancel
            button(type='submit', class='button button-primary') Approve
